<!doctype html>
<html>
    <head>
        <meta charset="UTF-8" />
        <title>Electron</title>
        <!-- https://developer.mozilla.org/en-US/docs/Web/HTTP/CSP -->
        <!-- <meta
            http-equiv="Content-Security-Policy"
            content="default-src 'self'; script-src 'self'; style-src 'self' 'unsafe-inline'; img-src 'self' data:; connect-src 'self' https://v2.api-m.com"
        /> -->
        <script type="module">
            // 使用 import.meta.env 读取环境变量
            const apiUrl = import.meta.env.VITE_BASE_URL; // 读取环境变量

            const cspMetaTag = document.createElement('meta');
            cspMetaTag.setAttribute('http-equiv', 'Content-Security-Policy');
            cspMetaTag.setAttribute(
                'content',
                `default-src 'self'; script-src 'self'; style-src 'self' 'unsafe-inline'; img-src 'self' data:; connect-src 'self' ${apiUrl}`
            );
            document.head.appendChild(cspMetaTag);
        </script>
    </head>

    <body>
        <div id="app"></div>
        <script
            type="module"
            src="/src/main.ts"
        ></script>
    </body>
</html>

